﻿Public Class DefaultIconCommand
    Inherits CommandBase
    Private _iconpath As String
    Private previousfile As Byte()
    Public Sub New(ByVal IconPath As String)
        _iconpath = IconPath
    End Sub
    Friend Overrides Sub Execute()
        previousfile = File.ReadAllBytes(_iconpath)
        File.Copy(_iconpath.Replace(Toolbox.TempPath, "").Replace("TemporaryFiles\", "ThemeTemplates\1.0.2\").Replace("\Theme\", "\Default\"), _iconpath, True)
        onImagingChanged(Me, New ImagingChangedEventArgs(""))
    End Sub

    Friend Overrides Sub Undo()
        File.WriteAllBytes(_iconpath, previousfile)
        onImagingChanged(Me, New ImagingChangedEventArgs(_iconpath))
    End Sub
End Class